package com.zyh.demo;

import java.io.*;
import java.nio.charset.Charset;

/**
 * @Author zyh
 * @Date 2024/8/6 11:40
 * @Description
 *  打印字节流
 *  打印字符流
 */

public class IODemo3 {
    public static final String FILE_PATH="D:\\Code\\IDEA\\idea_projects\\JavaSE-plus\\day10-code\\src\\com\\zyh\\resources\\Print.txt";

    //打印字符流
    public static void main(String[] args) throws IOException {
        PrintWriter pw = new PrintWriter(new FileOutputStream(FILE_PATH), true, Charset.forName("UTF-8"));
        pw.println(90);
        pw.println("你好");
        pw.println('9');
    }



    //打印字节流
    public static void main1(String[] args) throws IOException {
        PrintStream ps = new PrintStream(new FileOutputStream(FILE_PATH),true,"UTF-8");
        ps.println("你好");
        ps.println('a');
        ps.println(90.9);
    }
}
